players = ['charles','martian','michael','florence','eli']
print(players[0:3]) 
print(players[1:4])
print(players[:4])
print(players[2:])
print(players[-3:])

print("Here are the first three players on my team:")
for player in players[:3]:
	print(player.title())

my_food = ['pizza','falafel','carrot cake']
friend_foods = my_food[:]
my_food.append('cannoli')
friend_foods.append('ice cream')
print("my favorite foods are:")
print(my_food)
print("\nMy friend's favorite foods are:")
print(friend_foods)

print("\n")
print("----------练习----------\n")
#练习4-10
print("----------练习4-10----------\n")
print(f"The first three items in the list are {players[0:3]}")
print(f"Three items from the middle of the list are: {players[1:4]}")
print(f"The last three items in the list are: {players[-3:]}")

#练习4-11
print("----------练习4-11----------\n")
pizzas = ["big pizza","pan pizza","milk pizza"]
for pizza in pizzas:
	print(f"{pizza.title()},is my favorite pizza")
	print(f"my favorite pizza is {pizza.title()}")
print("----------练习4-11，方案2.1----------\n")
for pizza in pizzas:
	print(f"I like {pizza}")
	print("----------练习4-11，方案2.2----------\n")
	print("I Like "+pizza)
	print("----------end----------\n")
for pizza in pizzas:
	print("I really like "+pizza+" very much")
	print("I really love pizza")
